// import Mock from 'mockjs'
// import { param2Obj } from '@/utils'
// const usekey = '13049352426' // 公司（admin）账号
const usekey = '15110288389' // 司机账号
const ssoTokenMap = {
  15110288389: {
    access_token: 'xxxxxx',
    accountId: 102,
    corpName: '中联物流（中国）有限公司',
    expires_in: 7199,
    gmt_create: '1933259587336',
    jti: 'ac0f5ad5-afc2-4832-a40d-3873c09f5793',
    refresh_token: 'rrrrr',
    roles: [{ authority: 'ROLE_NORMAL' }],
    scope: 'all',
    tenantId: 1,
    token_type: 'bearer',
    username: '15110288389@163.com'
  },
  13049352426: {
    access_token: 'xxxxxx',
    accountId: 624,
    corpName: '中联无忧426',
    expires_in: 7199,
    gmt_create: '1933259587336',
    jti: '0ae04534-1a9c-4294-96da-40f2bd75940b',
    refresh_token: 'rrrrr',
    roles: [{ authority: 'ROLE_ADMIN' }],
    scope: 'all',
    tenantId: 168,
    token_type: 'bearer',
    username: '13049352426'
  }
}
const userMap = {
  15110288389: {
    code: 0,
    message: 'success',
    data: {
      authStatus: 1,
      dob: null,
      driverLicenseAttachName: null,
      driverLicenseEndDate: null,
      driverLicenseFirstDate: null,
      driverLicenseId: null,
      driverLicenseKey: null,
      driverLicensePath: null,
      driverLicenseStartDate: null,
      drivingLicenseType: 'C1',
      fleetId: null,
      id: 224,
      idCardAttachName: null,
      idCardKey: null,
      idCardPath: null,
      licenseId: null,
      lspId: 6,
      lspName: null,
      mobile: '15110288389',
      name: '叶真志',
      operatingLicenseAttachName: null,
      operatingLicenseKey: null,
      operatingLicensePath: null,
      reverseIdCardAttachName: null,
      reverseIdCardKey: null,
      reverseIdCardPath: null,
      serviceType: 'fleet',
      sex: 0,
      status: 1,
      weixinId: null,
      withIdCardAttachName: null,
      withIdCardKey: null,
      withIdCardPath: null,
      yod: 4
    }
  },
  13049352426: {
    code: 0,
    message: 'success',
    data: {}
  }
}
const userInfoMap = {
  13049352426: {
    code: 0,
    message: 'success',
    data: {
      id: 73,
      code: '13049352426',
      name: '中联无忧426',
      workingSite: '深圳市南山区',
      registrySite: null,
      legalRep: null,
      registryCapital: null,
      repMobile: '13049352426',
      tenantId: 168,
      gmtCreate: 1942419610000,
      gmtUpdate: 1943027720000,
      nameAbbr: null,
      remark: null,
      serviceType: null,
      status: 1,
      authStatus: 1,
      creator: '13049352426',
      createFrom: '运力微信公众号',
      businessSite: null,
      isDelete: 0
    }
  }
}

export default {
  getSsoToken: config => {
    // const { username } = JSON.parse(config.body)
    // let temp = userMap[username]
    const resData = ssoTokenMap[usekey]
    console.log('mock-account-getSsoToken()-resData', resData)
    return resData
  },
  getLogin: config => {
    const resData = userMap[usekey]
    console.log('mock-account-getAccountInfo()-resData', resData)
    return resData
  },
  getAccountInfo: config => {
    // console.log('mock-account-getAccountInfo()-config', config)
    const resData = userInfoMap[usekey]
    console.log('mock-account-getAccountInfo()-resData', resData)
    return resData
  }
}
